<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 

<h:head>
<link href="/resources/css/diaryCSS.css" rel="stylesheet" type="text/css"/>
<title>Ежедневник "Все по плану".</title>
</h:head> 
<h:body>
    <ui:composition template="/templates/topBottom.xhtml">
            
            <ui:define name="topleft">
                
               <h:form id="topleft">
                	Ежедневник &nbsp;                	
                	<h:commandLink value="Главная" action="portal"/>
               </h:form> 
            </ui:define> 
            
            <ui:define name="topright">
            	<h:form id="topright">
            	    <h:outputLabel value="#{filterDiary.label}" />
					<h:outputLabel value="#{login.login}" /> &nbsp;               		
                	<h:commandLink value="#{login.loginLabel}" action="#{login.logInLogOut}"/>
                </h:form>
            </ui:define>     

            <ui:define name="content">
            
            	<div style="float: left; width: 135px">
            		<h:outputText value="Цели на год: " /><br/>
		            <h:outputText value="Цели на месяц: " /><br/>
		            <h:outputText value="Цели на неделю: " /><br/><br/><br/>
		            <h:outputText value="Дело дня: " /><br/>
		            <h:outputText value="Лягушка: " /><br/>
		            <h:outputText value="Бифштекс: " /><br/>
            	</div>
            	<div style="float: right; width: 220px">
            		<h:form id="formcalendar">         		
            			<rich:calendar popup="false" id="calendar" value="#{diaryBean.calDate}" locale="#{diaryBean.locale}">      
            				<a4j:ajax render="goalgread paneltext panelevent" listener="#{diaryBean.test}"/>            				
            			</rich:calendar>             		 			      			
            		</h:form> 
            		</div >
            	<div style="margin-left: 135px; margin-right: 230px; height : 222px; ">
            	<h:form id="formGoal">
            		<a4j:outputPanel id="goalgread">
	            		<h:inputText value="#{diaryBean.myGoal.goalYear}" size="80" style=" width : 100%;" styleClass="hCommandMargBot" id="goalyear"/>            		 
			            <h:inputText value="#{diaryBean.myGoal.goalMonth}" size="80" style=" width : 100%;" styleClass="hCommandMargBot"/>
			            <h:inputText value="#{diaryBean.myGoal.goalWeek}" size="80" style=" width : 100%;" styleClass="hCommandMargBot"/>
			            <div style="margin-top: 30px">
			            	<h:inputText value="#{diaryBean.myGoal.goalDay}" size="180" style=" width : 100%;" styleClass="hCommandMargBot"/>
		                	<h:inputText value="#{diaryBean.myGoal.frog}" size="180" style=" width : 100%;" styleClass="hCommandMargBot"/>
		                	<h:inputText value="#{diaryBean.myGoal.beefsteak}" size="180" style=" width : 100%;" styleClass="hCommandMargBot"/>
		                </div>
		                <a4j:commandButton value="Сохранить" render="@form" id="hiddengoal" style="visibility:hidden;" onclick="(document.getElementById('formtext:hiddentask')).click(); "/>
		            </a4j:outputPanel>
	            </h:form>
            	</div>
            	<h:form id="formtext">
            		<div style="margin-left: 135px; margin-right: 230px">
		            	<a4j:outputPanel id="paneltext">
			            	<div style="float: left; width: 50%" align="center">
			            		<h:outputText value="Жесткие задачи" />
			            		<h:inputTextarea style="width : 99%; height : 170px; " value="#{diaryBean.myGoal.toughTask}"/>
			            	</div>
			            	<div style="margin-left: 50%" align="center">
			            		<h:outputText value="Гибкие задачи" />
			            		<h:inputTextarea style="width : 99%; height : 170px;" value="#{diaryBean.myGoal.fixTask}"/>
			            	</div>
			            	 <a4j:commandButton value="Сохранить" render="paneltext" id="hiddentask" style="visibility:hidden;" onclick="(document.getElementById('formevent:hiddenevent')).click(); "/>
			            </a4j:outputPanel>
			         </div>
            	</h:form>
            	<div style="float: left; width: 135px">
            		<h:outputText value="Событие дня: " /><br/>
		            <h:outputText value="Награды: " /><br/>		            
            	</div>
            	<div style="float: right; width: 220px;" align="center">
            		<h:form id="formbutton">
            			<a4j:commandButton value="Сохранить" style="height:34px;width:90px;" action="#{diaryBean.apply}" onclick="(document.getElementById('formGoal:hiddengoal')).click(); " /> 
            		</h:form>	            		            		            		            		
            	</div >
            	<h:form id="formevent">
            		<a4j:outputPanel id="panelevent">
		            	<div style="margin-left: 135px; margin-right: 230px;">
		            		<h:inputText value="#{diaryBean.myGoal.eventDay}" size="80" style=" width : 100%;" styleClass="hCommandMargBot"/>
				            <h:inputText value="#{diaryBean.myGoal.award}" size="80" style=" width : 100%;" styleClass="hCommandMargBot"/>	
				            <a4j:commandButton value="Сохранить" render="@form" id="hiddenevent" style="visibility:hidden;"/>	           
		            	</div>
		            </a4j:outputPanel>       		            	
            	</h:form>
            </ui:define>

            <ui:define name="bottom">
            </ui:define>

        </ui:composition>
</h:body> 
</html>
